Contact Hunter API is a powerful tool for scraping Google Maps business data and extracting contact details from websites. If you’re setting up your own instance on a VPS (like DigitalOcean, AWS, or any Linux server), this guide will walk you through the process from zero to production—step by step.
No previous server experience? Don’t worry—we’ll make it simple.
🛠️ Prerequisites
Before we start, make sure you have:
✅ A VPS running Ubuntu 22.04 or later (we recommend at least 1 vCPU & 2 GB RAM for smooth performance).
✅ Root access (SSH credentials) to your VPS.
If you don’t already have a VPS, DigitalOcean is a great choice. Sign up using my special link below and get $200 free credit for the first 60 days. Perfect for setting up your Contact Hunter API and testing it out risk-free.
💰 Get $200 DigitalOcean Free Trial: Claim Offer
📦 Step 1: Connect to Your Server
Open your terminal and SSH into your VPS:
ssh root@YOUR_SERVER_IP
Replace YOUR_SERVER_IP
with your VPS IP address.
🔄 Step 2: Update Your Server
Run these commands to update your server packages to the latest versions:
apt update && apt upgrade -y
🖥️ Step 3: Install Required System Libraries
Puppeteer (used by Contact Hunter) requires some system libraries for headless Chromium. Install them with:
apt install -y \
libasound2t64 libatk-bridge2.0-0t64 libatk1.0-0t64 \
libcups2t64 libdrm2 libgbm1 libgtk-3-0t64 libnss3 \
libx11-xcb1 libxcomposite1 libxdamage1 libxrandr2 \
libpangocairo-1.0-0 libpangoft2-1.0-0
This ensures Chromium can run properly inside Puppeteer.
🟢 Step 4: Install Node.js and npm
Contact Hunter runs on Node.js. To install Node.js 18.x (LTS)
curl -fsSL https://deb.nodesource.com/setup_18.x | bash -
apt install -y nodejs
Verify installation:
node -v
npm -v
⚡ Step 5: Install PM2 Process Manager
PM2 keeps your API running in the background—even after server restarts
npm install -g pm2
📥 Step 6: Clone Contact Hunter API
Clone the GitHub repository:
git clone https://github.com/Rajeevdaz/contact-hunter-api.git
cd contact-hunter-api
📦 Step 7: Install Node.js Dependencies
Run:
npm install
This will download all required packages.
🔐 Step 8: Configure Environment Variables
Copy the example environment file:
cp .env.example .env
Then edit .env
to add your API key or other settings:
nano .env
Save changes with CTRL+O
, then exit with CTRL+X
.
🚀 Step 9: Start the API with PM2
Start the API and make it persistent:
pm2 start app.js --name contacthunter
pm2 save
pm2 startup
🔥 Step 10: Open Firewall Ports
If UFW (Uncomplicated Firewall) is enabled, allow SSH and API traffic:
ufw allow OpenSSH
ufw allow 3000
ufw enable
✅ Done!
Your Contact Hunter API is now live at:
http://YOUR_SERVER_IP:3000
🚀 Test Contact Hunter API Endpoints
Once your server is up and running, you can test the API using cURL or Postman.
✅ 1. Test the /gmap
endpoint (Scrape Google Maps)
This endpoint scrapes businesses from Google Maps based on your query.
Sample cURL Request:
curl -X GET "http://YOUR_SERVER_IP:3000/gmap?query=restaurants+in+new+york&count=10" \
-H "api-key: YOUR_API_KEY"
- Replace
YOUR_SERVER_IP
with your VPS IP - Replace
YOUR_API_KEY
with the API key from your.env
file - Adjust the
query
parameter to your target location/business count
defines how many businesses to fetch (optional, defaults to 5)
✅ 2. Test the /website
endpoint (Extract Contact Info)
This endpoint extracts emails, Facebook, and Instagram links from a website.
Sample cURL Request:
curl -X GET "http://YOUR_SERVER_IP:3000/website?url=https://example.com" \
-H "api-key: YOUR_API_KEY"
- Replace
https://example.com
with the website URL you want to scrape. - Replace
YOUR_API_KEY
with your actual API key.
📥 Download the N8N Workflow Template (JSON)
To save time, I’ve included the ready-to-use n8n workflow JSON file. Simply import it into your n8n instance and start scraping leads instantly.
• Download Workflow JSON : Download